import controller.content.GoodsController;
import controller.content.StoreController;
import controller.entity.Page;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import service.GoodsStoreService;

/**
 * Created by asus on 2017/6/22.
 */

public class test1 {

    private GoodsStoreService goodsStoreService;
    private GoodsController goodsController;
    private StoreController storeController;

    @Test
    public void testGoodsInStroeDTO(){
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
        System.out.println(applicationContext);
        goodsStoreService= (GoodsStoreService) applicationContext.getBean("goodsStoreService");
        System.out.println(goodsStoreService);
        Page page=new Page(1,10,1);
        System.out.println(goodsStoreService.getPageGoodsInStore(page));
    }

    @Test
    public void testStoreCombobox(){
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
        System.out.println(applicationContext);
        storeController= (StoreController) applicationContext.getBean("storeController");
        System.out.println(storeController);
        System.out.println(storeController.getSimpleList());
    }


    @Test
    public void testGoodsCombobox(){
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
        System.out.println(applicationContext);
        goodsController= (GoodsController) applicationContext.getBean("goodsController");
        System.out.println(goodsController);
        System.out.println(goodsController.simpleList());
    }
}
